#ifndef CLIENT_H
#define	CLIENT_H

#include <stddef.h>
#include "rbtree.h"

#define BUF_LEN 2048 //buffer block length
#define NAMEBUF_LEN 30

struct client
{
    struct rb_node node;
    int fd;
    char name[NAMEBUF_LEN];
    char data_buf[BUF_LEN];
    size_t idx;
};

struct client *add_client(struct rb_root *root,int fd);
void del_client(struct rb_root *root,struct client* cl);
struct client *get_client(struct rb_root *root,int fd);


#endif	/* CLIENT_H */

